/*
 * Copyright 2011 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.inftel.tms.mobile;

import android.app.AlarmManager;

public class TmsConstants {

    /**
     * TODO **P1** You must put your Google Places API key here. You can get
     * your API key from: {@link http
     * ://code.google.com/apis/maps/documentation/places/#Limits}
     */
    private static String MY_API_KEY = "AIzaSyBJSaRUm_ngBawVPmP6NZ3ME_pKJ3ZG-K8";

    public static String PLACES_API_KEY = "&key=" + MY_API_KEY;

    /**
     * You'll need to modify these values to suit your own app.
     */
    // TODO Turn off when deploying your app.
    public static boolean DEVELOPER_MODE = true;

    // TODO Point these at your data sources.
    public static String PLACES_LIST_BASE_URI = "https://maps.googleapis.com/maps/api/place/search/xml?sensor=true";
    public static String PLACES_DETAIL_BASE_URI = "https://maps.googleapis.com/maps/api/place/details/xml?sensor=true&reference=";
    public static String PLACES_CHECKIN_URI = "https://maps.googleapis.com/maps/api/place/check-in/xml?sensor=true";
    public static String PLACES_CHECKIN_OK_STATUS = "OK";

    /**
     * These values control the user experience of your app. You should modify
     * them to provide the best experience based on how your app will actually
     * be used. TODO Update these values for your app.
     */
    // The default search radius when searching for places nearby.
    public static int DEFAULT_RADIUS = 150;
    // The maximum distance the user should travel between location updates.
    public static int MAX_DISTANCE = DEFAULT_RADIUS / 2;
    // The maximum time that should pass before the user gets a location update.
    public static long MAX_TIME = AlarmManager.INTERVAL_FIFTEEN_MINUTES;

    // The maximum distance for legacy passive location change.
    public static int PASSIVE_LOCATION_MAX_DISTANCE = 10;
    // The maximum time for legacy passive location change.
    public static long PASSIVE_LOCATION_MAX_TIME = AlarmManager.INTERVAL_FIFTEEN_MINUTES;

    // You will generally want passive location updates to occur less frequently
    // than active updates. You need to balance location freshness with battery
    // life.
    // The location update distance for passive updates.
    public static int PASSIVE_MAX_DISTANCE = MAX_DISTANCE;
    // The location update time for passive updates
    public static long PASSIVE_MAX_TIME = MAX_TIME;
    // Use the GPS (fine location provider) when the Activity is visible?
    public static boolean USE_GPS_WHEN_ACTIVITY_VISIBLE = true;
    // When the user exits via the back button, do you want to disable
    // passive background updates.
    public static boolean DISABLE_PASSIVE_LOCATION_WHEN_USER_EXIT = false;

    // Maximum latency before you force a cached detail page to be updated.
    public static long MAX_DETAILS_UPDATE_LATENCY = AlarmManager.INTERVAL_DAY;

    // Prefetching place details is useful but potentially expensive. The
    // following
    // values lets you disable prefetching when on mobile data or low battery
    // conditions.
    // Only prefetch on WIFI?
    public static boolean PREFETCH_ON_WIFI_ONLY = false;
    // Disable prefetching when battery is low?
    public static boolean DISABLE_PREFETCH_ON_LOW_BATTERY = true;

    // How long to wait before retrying failed checkins.
    public static long CHECKIN_RETRY_INTERVAL = AlarmManager.INTERVAL_FIFTEEN_MINUTES;

    // The maximum number of locations to prefetch for each update.
    public static int PREFETCH_LIMIT = 5;

    /**
     * These values are constants used for intents, exteas, and shared
     * preferences. You shouldn't need to modify them.
     */

    public static String SP_KEY_FOLLOW_LOCATION_CHANGES = "SP_KEY_FOLLOW_LOCATION_CHANGES";
    /* Datos de la ultima comprobacion de las vallas */
    public static String SP_KEY_LAST_FENCES_CHECK_TIME = "SP_KEY_LAST_FENCES_CHECKTIME";
    public static String SP_KEY_LAST_FENCES_CHECK_LAT = "SP_KEY_LAST_FENCES_CHECKLAT";
    public static String SP_KEY_LAST_FENCES_CHECK_LNG = "SP_KEY_LAST_FENCES_CHECKLNG";
    /* Datos del ultimo envio de posicion */
    public static String SP_KEY_LAST_TRACKING_TIME = "SP_KEY_LAST_TRACKING_TIME";
    public static String SP_KEY_LAST_TRACKING_LAT = "SP_KEY_LAST_TRACKING_LAT";
    public static String SP_KEY_LAST_TRACKING_LNG = "SP_KEY_LAST_TRACKING_LNG";

    public static String SP_KEY_LAST_CHECKIN_ID = "SP_KEY_LAST_CHECKIN_ID";
    public static String SP_KEY_LAST_CHECKIN_TIMESTAMP = "SP_KEY_LAST_CHECKIN_TIMESTAMP";
    /* Aplicacion ejecutada almenos una vez */
    public static String SP_KEY_RUN_ONCE = "SP_KEY_RUN_ONCE";

    public static String EXTRA_KEY_REFERENCE = "reference";
    public static String EXTRA_KEY_ID = "id";
    public static String EXTRA_KEY_LOCATION = "location";
    public static String EXTRA_KEY_RADIUS = "radius";
    public static String EXTRA_KEY_TIME_STAMP = "time_stamp";
    public static String EXTRA_KEY_FORCEREFRESH = "force_refresh";
    public static String EXTRA_KEY_FORCETRACK = "force_track";
    public static String EXTRA_KEY_IN_BACKGROUND = "EXTRA_KEY_IN_BACKGROUND";
    public static String EXTRA_KEY_MESSAGE_CONTENT = "message_content";

    public static String ARGUMENTS_KEY_REFERENCE = "reference";
    public static String ARGUMENTS_KEY_ID = "id";
    public static String ARGUMENTS_CONTENT_URI = "content_uri";

    public static String NEW_CHECKIN_ACTION = "com.radioactiveyak.places.NEW_CHECKIN_ACTION";
    public static String RETRY_QUEUED_CHECKINS_ACTION = "com.radioactiveyak.places.retry_queued_checkins";
    public static String ACTIVE_LOCATION_UPDATE_PROVIDER_DISABLED = "com.radioactiveyak.places.active_location_update_provider_disabled";

    public static boolean SUPPORTS_GINGERBREAD = android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.GINGERBREAD;
    public static boolean SUPPORTS_HONEYCOMB = android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB;
    public static boolean SUPPORTS_FROYO = android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.FROYO;
    public static boolean SUPPORTS_ECLAIR = android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.ECLAIR;

    public static String CONSTRUCTED_LOCATION_PROVIDER = "CONSTRUCTED_LOCATION_PROVIDER";

    public static int CHECKIN_NOTIFICATION = 0;

    /**
     * PREFERENCES: Se corresponden con las keys definidas en
     * res/xml/preferences.xml
     */
    public static String SHARED_PREFERENCE_FILE = "SHARED_PREFERENCE_FILE";
    public static String KEY_IP_PREFERENCE = "ip_preference";
    public static String KEY_PORT_PREFERENCE = "port_preference";
    public static String KEY_PATH_PREFERENCE = "path_preference";
    public static String KEY_PHONE_NUMBER_PREFERENCE = "phone_number_preference";

}
